import request from '@/utils/http'
import { BaseResponse } from '@/types/api'

//查询题库分组分页接口
export class getcategoryList {
  static getcategoryId(params: object) {
    return request.get<BaseResponse>({
      url: `ds-question-group/page`,
      params
    })
  }

  //

  static getNewCateGoryId(params: object) {
    return request.get<BaseResponse>({
      url: `ds-question-group/pageV2`,
      params
    })
  }

  // 获取所有任务的树形id  /api/v1/ds-question-group/tree
  static getcategoryTreeList(params: object) {
    return request.get<BaseResponse>({
      url: `ds-question-group/tree`,
      params
    })
  }
}

// 操作题目分组  api/questionbanklabel
export class operationCategory {
  static addCategory(params: object) {
    return request.post<BaseResponse>({
      url: `ds-question-group`,
      params
    })
  }

  static newAddCategory(data: object) {
    return request.post<BaseResponse>({
      url: 'ds-question-group/saveV2',
      data
    })
  }

  // ds-question-group/{id}
  static eidtCategory(params: object, id: string) {
    return request.put<BaseResponse>({
      url: `ds-question-group/${id}`,
      params
    })
  }

  // 删除题目分组  ds-question-group/{ids}
  static deleteCategory(ids: string) {
    return request.del<BaseResponse>({
      url: `ds-question-group/${ids}`
    })
  }

  // 首页 新增用户 今日新增
  // static count() {
  //   return request.get<BaseResponse>({
  //     url: `ds-user/count`,
  //   })
  // }
  static homeCount() {
    return request.get<BaseResponse>({
      url: `ds-store/systemHomePage`
    })
  }

  static copyGroup(id: number) {
    return request.get<BaseResponse>({
      url: `ds-question-group/copy/${id}`
    })
  }
}
